using MediatR;
using RBAC.ErrorCode;
using System.ComponentModel.DataAnnotations;

namespace RBAC.Write.Api.Application.Command.ERP.MaterialFile
{
    /// <summary>
    /// 更新物料分类命令
    /// </summary>
    public class UpdateMaterTypeCommand : IRequest<APIResult<bool>>
    {
        /// <summary>
        /// 物料分类ID
        /// </summary>
        [Required(ErrorMessage = "分类ID不能为空")]
        public long Id { get; set; }

        /// <summary>
        /// 分类编码
        /// </summary>
        [Required(ErrorMessage = "分类编码不能为空")]
        [StringLength(50, ErrorMessage = "分类编码长度不能超过50个字符")]
        public string TypeCode { get; set; }

        /// <summary>
        /// 分类名称
        /// </summary>
        [Required(ErrorMessage = "分类名称不能为空")]
        [StringLength(100, ErrorMessage = "分类名称长度不能超过100个字符")]
        public string TypeName { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string? Unit { get; set; }

        /// <summary>
        /// 状态 0-启用 1-禁用
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 流水号长度
        /// </summary>
        [Range(1, 10, ErrorMessage = "流水号长度必须在1-10之间")]
        public int Lenght { get; set; }

        /// <summary>
        /// 供应方式
        /// </summary>
        public string? SupplyMode { get; set; }

        /// <summary>
        /// 上级分类ID
        /// </summary>
        public long? ParentId { get; set; }
    }
}